import {
    COUNT_ADD,
    COUNT_SUB,
    GET_CNODE_LIST
} from '../../store/actionType'
const initState = {
    count: 1,
    list:[]
}

export default (state = initState, action)=>{
    //do something
    let newState = JSON.parse(JSON.stringify(state))
    switch (action.type) {
        case COUNT_ADD:
            newState.count += action.payload
            break
        case COUNT_SUB:
            newState.count -= action.payload
            break
        case GET_CNODE_LIST:
            newState.list = action.payload
            break
    }
    return newState
}